package com.yuanian.timingwheel.dao;

import com.yuanian.timingwheel.respository.po.TaskEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface TaskDao {
//SpringContext.getBean(Database.class).find(TaskEntity.class).where().eq("type", 1).findList();

    List<TaskEntity> getAutoTask();

    List<TaskEntity> getEndOfDayTask(@Param("date") Date date);

    void save(TaskEntity taskEntity);

    int update(TaskEntity taskEntity);

    TaskEntity getTaskByID(@Param("taskId") Long taskId);

    TaskEntity getTaskByBusinessId(@Param("businessId")String businessId);

    int delete(@Param("taskId") Long taskId);

    int suspendOrResume(@Param("status") int status, @Param("taskId") Long taskId);

    int updateExecutionTime(@Param("executionTime") Date executionTime, @Param("taskId") Long taskId);
}
